package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.AlarmRulesMapper;
import com.ruoyi.gybj.domain.AlarmRules;
import com.ruoyi.gybj.service.IAlarmRulesService;

/**
 * 报警规则Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class AlarmRulesServiceImpl implements IAlarmRulesService 
{
    @Autowired
    private AlarmRulesMapper alarmRulesMapper;

    /**
     * 查询报警规则
     * 
     * @param id 报警规则主键
     * @return 报警规则
     */
    @Override
    public AlarmRules selectAlarmRulesById(Long id)
    {
        return alarmRulesMapper.selectAlarmRulesById(id);
    }

    /**
     * 查询报警规则列表
     * 
     * @param alarmRules 报警规则
     * @return 报警规则
     */
    @Override
    public List<AlarmRules> selectAlarmRulesList(AlarmRules alarmRules)
    {
        return alarmRulesMapper.selectAlarmRulesList(alarmRules);
    }

    /**
     * 新增报警规则
     * 
     * @param alarmRules 报警规则
     * @return 结果
     */
    @Override
    public int insertAlarmRules(AlarmRules alarmRules)
    {
        alarmRules.setCreateTime(DateUtils.getNowDate());
        return alarmRulesMapper.insertAlarmRules(alarmRules);
    }

    /**
     * 修改报警规则
     * 
     * @param alarmRules 报警规则
     * @return 结果
     */
    @Override
    public int updateAlarmRules(AlarmRules alarmRules)
    {
        alarmRules.setUpdateTime(DateUtils.getNowDate());
        return alarmRulesMapper.updateAlarmRules(alarmRules);
    }

    /**
     * 批量删除报警规则
     * 
     * @param ids 需要删除的报警规则主键
     * @return 结果
     */
    @Override
    public int deleteAlarmRulesByIds(Long[] ids)
    {
        return alarmRulesMapper.deleteAlarmRulesByIds(ids);
    }

    /**
     * 删除报警规则信息
     * 
     * @param id 报警规则主键
     * @return 结果
     */
    @Override
    public int deleteAlarmRulesById(Long id)
    {
        return alarmRulesMapper.deleteAlarmRulesById(id);
    }
}
